import random

import requests
# url = "https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=18329835833"
# r = requests.get(url,timeout=0.5)
# print(r.text)
#
# canshu1= {
#     "loginname"	:"admin",
#     "pwd"	:"123456"
# }
# url1 = "http://192.168.2.36:8088/carRental/"
#
# r1 = requests.post(url1,data = canshu1)
s = requests.session()

canshu2 = {
    "carnumber":	"下A" + str(random.randint(100000,9999999)),
    "cartype"	:"1小众",
    "color":"黑色",
    "carimg"	:"c:/2.jpg",
    "description"	:"123456",
    "price"	:"123456",
    "rentprice":	"123456",
    "deposit"	:"123456",
    "isrenting":	"0"
}
hand = {
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
url2 = "http://192.168.2.36:8088/carRental/car/addCar.action"
r2 = s.post(url2,data=canshu2,headers=hand)
print(r2.json())
